package com.sf.dlb.jpa.repository;

import com.sf.dlb.jpa.model.UserMessageStateInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 用户消息状态表 Repository
 *
 * Created by jing.tan on 2018/5/21.
 */
@Repository
public interface UserMessageStateRepository extends JpaRepository<UserMessageStateInfo, Long> {
    /**
     * 根据查询-userid,state
     * @param userId
     * @param state
     * @return
     */
    List<UserMessageStateInfo> findByUserIdAndState(String userId, String state);

    /**
     * 根据消息id，查询消息
     * @param messageId
     * @return
     */
    List<UserMessageStateInfo> findByMessageId(String messageId);
    /**
     * 根据查询-id
     * @param id
     * @return
     */
    UserMessageStateInfo findById(Long id);
}